package errors;
import ast.Loc;

/**
 * @author nancel
 *
 */
public class TypeError extends Error {

	private static final long serialVersionUID = -6060523145201023463L;
	
	private Loc l;
	private String msg;
	
	public TypeError(String r, Loc l) {
		msg = r;
		this.l = l;
	}
	
	public TypeError(String r) {
		msg = r;
	}
	
	public String toString() 
	{
		String s = "ligne " ;
		if( l != null ) s+= l.loc_line ; else s+="?" ;
		s+= ", caractere " ;
		if( l != null ) s+= l.loc_char ;else s+="?" ;
		s+= " " + msg ;
		return s ;
	}

}
